package ru.jexp.rcp.supply.wizard;

import org.eclipse.core.runtime.ListenerList;
import org.eclipse.jface.wizard.Wizard;

public abstract class JExpWizardDefault extends Wizard implements JExpWizard {

	private ListenerList listeners = new ListenerList();
	
	@Override
	public void addWizardListener(JExpWizardListener listener) {
		listeners.add(listener);
	}

	@Override
	public void fireWizardListeners(int typeEvent) {
		Object[] copyListeners = listeners.getListeners();
		for (int i = 0; i < copyListeners.length; i++) {
			JExpWizardListener listener = (JExpWizardListener) copyListeners[i];
			listener.event(typeEvent);
		}
	}

	@Override
	public void removeWizardListener(JExpWizardListener listener) {
		listeners.remove(listener);
	}

}
